<!DOCTYPE html>
<html>

@extends('layout.page')
@section('title','活动 - 详情')
@section('static-page')
    <div class="form-group">
        <div class="col-sm-10">
            <input class="form-control" id="keyword" value="{{$keyword}}">
        </div>
        <div class="col-sm-2">
            <a class="btn btn-success" id="search-btn">搜索</a>
        </div>

    </div>
    <table class="table table-bordered text-center">
        <thead class="text-center">
        <tr>
            <th>ID</th>
            <th>活动名称</th>
            <th>活动时间</th>
            <th>关联群体</th>
            <th>活动奖励</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        @foreach($list as $activity)
            <tr>
                <td>{{$activity->id}}</td>
                <td>{{$activity->name}}</td>
                <td>{{date('Y/m/d',$activity->start_time)}} -- {{date('Y/m/d',$activity->end_time )}}</td>
                <td>{{$activity->user_filter}}</td>
                <td>{{$activity->rewards}}</td>
                <td>
                    @if($activity->status == \App\Constants\ActivityCheckStatus::PASS)
                        <b>审核通过</b> |
                        <a href="/ceb/activities/show?id={{$activity->id}}">查看报告</a>
                    @else
                        <a href="/ceb/activities/check?id={{$activity->id}}">审核</a> |
                        <a href="/ceb/activities/edit?id={{$activity->id}}">编辑</a> |
                        <a href="/ceb/activities/delete?id={{$activity->id}}">删除</a>
                    @endif
                </td>
            </tr>
        @endforeach
        </tbody>
    </table>
    @include('wiget.pager',[
        'page' => $page,
        'page_size' => $size,
        'count' => $count,
        'show_count' => 10,
        'path' => url('/ceb/activities/index?keyword=' . $keyword)
    ])
    <a class="btn btn-success" href="/ceb/activities/create">添加活动</a>
@endsection
@section('javascript')
    <script>

        $(document).ready(function () {

            $('#search-btn').on('click', function () {
                var keyword = $('#keyword').val();
                go_page('/ceb/activities/index', {keyword: keyword});
            });
        });
    </script>
@endsection
